package com.rstrulak.beans;

import java.io.Serializable;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Scope;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Component;

import com.rstrulak.dao.RoleDao;

@Component("user3")
@Scope("session")
public class UserBean3 implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 2057113996369789898L;
	private String name;
	private String password;
	@Autowired
	private RoleDao roleDao;
	
	@Autowired
	private UserBean2 userBean2;

	

	public RoleDao getRoleDao() {
		return roleDao;
	}
	
	public String getRoleName(){
		return roleDao.getById(1l).getName() + userBean2.getName() + "nie wierze?!";
	}

	public void setRoleDao(RoleDao roleDao) {
		this.roleDao = roleDao;
	}

	public String getName() {
		return name;
	}

	// public String getName() {return name +"spirng2 bean3";}
	public void setName(String newValue) {
		name = newValue;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String newValue) {
		password = newValue;
	}
}
